package com.njtcedu.microblog.intranet.systemconfig.web;

import java.util.Map;

import javax.inject.Inject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.njtcedu.microblog.intranet.systemconfig.service.SystemConfigService;
import com.njtcedu.microblog.intranet.systemconfig.web.request.AdImagesRequest;

@Controller
public class SystemConfigController {

	@Inject
	private SystemConfigService systemConfigService;
	
	@RequestMapping(value = "/intranet/advertising", method = RequestMethod.GET)
	public String toAdimagePage (Map<String, Object> map){
		map.put("images", systemConfigService.getAdImages());
		return "adimage_upload";
	}
	
	@RequestMapping(value = "/advertising", method = RequestMethod.POST)
	public String saveADImage(AdImagesRequest request) {
		systemConfigService.saveImageInfo(request);
		return "adimage_upload_secuss";
	}
}
